package com.zhuiyun.project.api.search.service.impl;

import com.zhuiyun.project.api.search.mapper.SearchMapper;
import com.zhuiyun.project.api.search.service.SearchService;
import com.zhuiyun.project.common.errorCode.CommonException;
import com.zhuiyun.project.common.response.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName SearchServiceImpl
 * @Description TODO 前端用户搜索界面
 * @Author YYR
 * @Date 2024/3/15 16:27
 **/
@Service
public class SearchServiceImpl implements SearchService {
    @Autowired
    private SearchMapper searchMapper;
    @Override
    public CommonResult getVideoByHot() throws CommonException {
        return CommonResult.ok(searchMapper.getVideoByHot());
    }

    @Override
    public CommonResult getFuzzyQuery(String keyword) {
        return CommonResult.ok(searchMapper.getFuzzyQuery(keyword));
    }
}
